# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=sdl2_mixer
pkgver=2.0.4
pkgrel=1
_pkgname=SDL2_mixer
pkgdesc="A simple multi-channel audio mixer"
url="http://www.libsdl.org/projects/SDL_mixer/"
arch="all"
license="Zlib"
makedepends="sdl2-dev libvorbis-dev libmikmod-dev
	libmodplug-dev flac-dev linux-headers"
subpackages="$pkgname-dev"
options="!check" # no test suite
source="https://www.libsdl.org/projects/SDL_mixer/release/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare
	update_config_sub

	sed -e "/CONFIG_FILE_ETC/s/\/etc\/timidity.cfg/\/etc\/timidity++\/timidity.cfg/" \
		-e "/DEFAULT_PATH/s/\/etc\/timidity/\/etc\/timidity++/" \
		-e "/DEFAULT_PATH2/s/\/usr\/local\/lib\/timidity/\/usr\/lib\/timidity/" \
		-i timidity/options.h
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-music-mod
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="98c56069640668aaececa63748de21fc8f243c7d06386c45c43d0ee472bbb2595ccda644d9886ce5b95c3a3dee3c0a96903cf9a89ddc18d38f041133470699a3  SDL2_mixer-2.0.4.tar.gz"
